package com.hd.openapi.servies.serviceimpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hd.openapi.common.ResultTable;
import com.hd.openapi.dao.serMapper;
import com.hd.openapi.entity.search;
import com.hd.openapi.servies.logser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class logserIMPL implements logser {
    @Autowired
    private serMapper ser;

    @Override
    public int adddata(search search) {
        int i = ser.insertAll (search);
        return i;
    }

    @Override
    public ResultTable getdata(Integer page, Integer limit,String realName) {
        PageHelper.startPage (page,limit);
        List<search> a=ser.getdataser(realName);
        PageInfo aa=new PageInfo (a);
        return new ResultTable (0,"",(int)aa.getTotal (),aa.getList ());
    }
}
